package com.wn.pettyloan.controller;

import com.wn.pettyloan.service.QuestionService;
import com.wn.pettyloan.util.Result;
import com.wn.pettyloan.vo.QandAVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: pettyloan
 * @ClassName QuestiuonController
 * @description:
 * @author: 韩旭
 * @create: 2022-12-14 09:47
 **/

@RestController
@RequestMapping("question")
public class QuestiuonController {
    @Resource
    private QuestionService questionService;

    @PostMapping("answer")
    public Result selectQuestionWithAnswer(){
        List<QandAVo> qandAVos = questionService.selectQuesAndAnswer();
        return Result.ok().data("questionList",qandAVos);
    }


}